<template>
	<u-popup v-model="openReplyTemp" mode="bottom" border-radius="14" height="80%" @close="rebackComment">
		<view style="height: 75%;margin: 5%;">
			<view v-for="item,key in commentInfo">
				<components2 :item="item" @remarkUsername='change($event)' @focus='getFocus($event)'></components2>
			</view>
			<u-divider style="margin: 10rpx;">以上为热门评论</u-divider>
		</view>
		<u-search v-model="remarkContent" :placeholder="remarkUsername" search-icon="edit-pen" maxlength='50'
			show-action="true" action-text="回复" :focus="focus" adjust-position="false" @blur="removeFocus"
			style="position: fixed;bottom:30px;width: 90%;margin-left: 5%;margin-right: 5%;">
		</u-search>
	</u-popup>
</template>

<script>
	import components2 from './comment_2.vue'

	export default {
		data() {
			return {
				openReplyTemp: this.openReply,
				commentInfo: [{
						nickname: "大利",
						src: 'https://ljy-picgo-1.oss-cn-shanghai.aliyuncs.com/img/20210428162157.jpg?versionId=CAEQIBiBgIDniqTeyBciIGM4MGU1YmU1ZTdlMDQ0OGE4YWUzOGFmYTcxMmQyZjRj',
						content: "傻狗火锅",
						createTime: "2021-04-29 11:11:11",
						hotNum: 12120,
						floorHeight: 1
					},
					{
						nickname: "火锅",
						src: 'https://ljy-picgo-1.oss-cn-shanghai.aliyuncs.com/img/20210428162157.jpg?versionId=CAEQIBiBgIDniqTeyBciIGM4MGU1YmU1ZTdlMDQ0OGE4YWUzOGFmYTcxMmQyZjRj',
						content: "放屁",
						createTime: "2021-04-28 11:11:11",
						hotNum: 1213,
						floorHeight: 2
					},
					{
						nickname: "臭臭",
						src: 'https://ljy-picgo-1.oss-cn-shanghai.aliyuncs.com/img/20210428162157.jpg?versionId=CAEQIBiBgIDniqTeyBciIGM4MGU1YmU1ZTdlMDQ0OGE4YWUzOGFmYTcxMmQyZjRj',
						content: "没错",
						createTime: "2021-04-27 11:11:11",
						hotNum: 12111,
						floorHeight: 3
					},
					{
						nickname: "小咪",
						src: 'https://ljy-picgo-1.oss-cn-shanghai.aliyuncs.com/img/20210428162157.jpg?versionId=CAEQIBiBgIDniqTeyBciIGM4MGU1YmU1ZTdlMDQ0OGE4YWUzOGFmYTcxMmQyZjRj',
						content: "没错",
						createTime: "2021-04-26 11:11:11",
						hotNum: 12111,
						floorHeight: 4
					},
					{
						nickname: "啵啵",
						src: 'https://ljy-picgo-1.oss-cn-shanghai.aliyuncs.com/img/20210428162157.jpg?versionId=CAEQIBiBgIDniqTeyBciIGM4MGU1YmU1ZTdlMDQ0OGE4YWUzOGFmYTcxMmQyZjRj',
						content: "没错",
						createTime: "2021-04-25 11:11:11",
						hotNum: 12111,
						floorHeight: 5
					}
					
				],
				remarkUsername: '',
				focus: false
			}
		},
		components: {
			components2
		},
		props: {
			openReply: {}
		},
		watch: {
			openReply: function(newVal, oldVal) {
				console.log("111" + newVal);
				console.log("222" + oldVal);
				this.openReplyTemp = newVal;
			}
		},
		methods: {
			rebackComment() {
				this.$emit('rebackReply', false)
			},
			change(data) {
				console.log(data);
				this.remarkUsername = data
			},
			getFocus(data) {
				console.log(data);
				this.focus = data;
			},
			removeFocus() {
				console.log("123123");
				this.focus = false;
			}

		}
	}
</script>

<style>
</style>
